#ifndef GLOBALVARS_H
#define GLOBALVARS_H

#include <QQueue>
#include <QSet>

#include "msgsocket.h"
#include "usrinfo.h"

#define USE_DATABASE 1

enum RESPONSE{
    RES_Down = '!',
    RES_Fail = '?'
};

enum COMMAND{
    ///用户请求命令
    CMD_UserLogin_L = 'L',          //用户登录
    CMD_ChangePswd_H = 'P',         //修改密码
    CMD_HomeChat_C = 'C',           //修改密码
    CMD_UserExit_X = 'X',           //用户退出
    ///设备控制命令
    CMD_DevTemp_T = 'T',            //获取温度
    CMD_DevHumi_H = 'H',            //获取湿度
    CMD_DevMode_M = 'M',            //获取信息
    CMD_DevStat_S = 'S',            //获取设备状态
    CMD_DevBeep_B = 'B',            //控制蜂鸣器
    CMD_DevLeds_D = 'D',            //控制灯光
    CMD_DevOLED_O = 'O',            //控制OLED显示屏
};

class GlobalVars
{
public:
    static QQueue<QString> g_msgQueue; //消息队列
    static UsrInfo g_localUsrInfo; //本地数据缓存
};

#endif // GLOBALVARS_H
